LLM and Compression report
This will be a running report of the “want todos”, “need todos”, “doings”, and “dones”. Over time, I hope that I will go from many “todos” and few “dones” to lots of “dones” and few “todos”.
1) Tasks
Zadani: Úkolem studenta či studentky by mělo být:
Otestovat existující jazykové modely, ať už natrénované na přirozeném jazyku či genomických sekvencích (DNABERT, DNABERT-2)
Stanovit jejich kompresní poměr na lidském genomu (případně dalších organismů) a porovnat je s běžnými modely komprese (gzip, 7zip).
Dále by mohlo být zajímavé zjistit, za jakou část komprese může tokenizer a za jakou samotný jazykový model.
Protože na rozdíl od přirozeného jazyka se bude komprese jednotlivých částí genomu velmi lišit, mohlo by být zajímavé vyrobit “mapu informačního obsahu” napříč lidským genomem.
Bonusovým úkolem by pak bylo otestovat, jestli lze takovouto mapu využít k zlepšení tréningu jazykového modelu (informačně hutnější úseky trénovat vícekrát).
1. Test existing language models trained on genomic sequences.
DNAGPT2 pretraining
I’m pretraining a series of small GPT2-like models.
The models have around \(86 \text{M}\) parameters and differ in the size of their vocabulary.
Model parameters + hyperparameters
@dataclass
class GPTConfig:
block_size: int = 1024
vocab_size: int = VOCAB_SIZE
n_layer: int = 12
n_head: int = 12
n_embd: int = 768
model_type: str = "gpt2"- batch size: \(2^{19}\) tokens (per GPT2 paper) - using gradient accumulation to achieve this with a single GPU
- micro batch size: \(B = 128\) (running on H100)
- cosine decay for learning rate scheduling
- max. learning rate: \(8e^{-4}\)
- warmed up linearly over \(1000\) steps
- then decay over the course of the epoch
- max. learning rate: \(8e^{-4}\)
- trained for a single epoch
Dataset
The models are pretrained on DNABERT2 dataset
The multi-species genome dataset encompasses genomes from \(135\) species, spread across \(6\) categories. In total, this dataset includes \(32.49\text{B}\) nucleotide bases, nearly \(12\) times the volume of the human genome dataset. We exclude all sequences with N and retain only sequences that consist of A, T, C, and G.